<h1>Listing campaigns</h1>

<table>
  <thead>
    <tr>
      <th>User</th>
      <th>Title</th>
      <th>Summary</th>
      <th>Description</th>
      <th>Charity</th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>

  <tbody>
    <% @campaigns.each do |campaign| %>
      <tr>
        <td><%= campaign.user_id %></td>
        <td><%= campaign.title %></td>
        <td><%= campaign.summary %></td>
        <td><%= campaign.description %></td>
        <td><%= campaign.charity_id %></td>
        <td><%= link_to 'Show', campaign %></td>
        <td><%= link_to 'Edit', edit_campaign_path(campaign) %></td>
        <td><%= link_to 'Destroy', campaign, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Campaign', new_campaign_path %>
